From 5dcf5d9b068ea42b8345dab5bb51e1e6aac19497 Mon Sep 17 00:00:00 2001 From: Justin Burkett Date: Fri, 19 May 2017 17:53:43 -0400 Subject: [PATCH] Use regexp-opt for regexps * which-key.el (which-key--get-keymap-bindings): Update --- which-key.el | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/which-key.el b/which-key.el index 8f1b038292f..50a3f84baca 100644 --- a/which-key.el +++ b/which-key.el @@ -40,6 +40,7 @@ (require 'cl-lib) (require 'button) +(require 'regexp-opt) ;; For compiler (defvar evil-operator-shortcut-map) @@ -1526,9 +1527,16 @@ Requires `which-key-compute-remaps' to be non-nil" "Generate a list of current active bindings." (let ((key-str-qt (regexp-quote (key-description which-key--current-prefix))) (buffer (current-buffer)) - (ignore-bindings '("self-insert-command" "ignore" "ignore-event" "company-ignore")) - (ignore-keys-regexp "mouse-\\|wheel-\\|remap\\|drag-\\|scroll-bar\\|select-window\\|switch-frame\\|-state") - (ignore-sections-regexp "\\(Key translations\\|Function key map translations\\|Input decoding map translations\\)")) + (ignore-bindings '("self-insert-command" "ignore" + "ignore-event" "company-ignore")) + (ignore-keys-regexp + (eval-when-compile + (regexp-opt '("mouse-" "wheel-" "remap" "drag-" "scroll-bar" + "select-window" "switch-frame" "-state")))) + (ignore-sections-regexp + (eval-when-compile + (regexp-opt '("Key translations" "Function key map translations" + "Input decoding map translations"))))) (with-temp-buffer (setq-local indent-tabs-mode t) (setq-local tab-width 8) -- 2.30.2